#!/bin/bash
sum=0
echo "请输入您要计算的数字，按 Ctrl+D 组合键结束读取"
while read n
do 
 ((sum += n))
done
echo "sum result: $sum"
